//
//  TextTableViewCell.m
//  Arts1
//
//  Created by 孤星晨宇 on 15/9/19.
//  Copyright (c) 2015年 Arts1. All rights reserved.
//

#import "TextTableViewCell.h"
#import "AllHeader.h"


@implementation TextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
         self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        _whiteView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH - 20, 40)];
        _whiteView.backgroundColor = [UIColor whiteColor];
         [self.contentView addSubview:_whiteView];
        
        _label = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, _whiteView.width - 20, 40)];
        [_whiteView addSubview:_label];
        
        UIView *tgrayview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _whiteView.width, 0.5)];
        tgrayview.backgroundColor = [UIColor grayColor];
        [_whiteView addSubview:tgrayview];
        
        UIView *bgrayview = [[UIView alloc] initWithFrame:CGRectMake(0, _whiteView.bottom - 0.5, _whiteView.width, 0.5)];
        bgrayview.backgroundColor = [UIColor grayColor];
        [_whiteView addSubview:bgrayview];
 
    }
    return self;
}

- (void)setText:(NSString *)text{
    _text = text;
    _label.text = _text;
    
    if (_index == 0) {
        [UIView viewRediusForLeftAndReightOfTop:_whiteView withRedius:4];
        _whiteView.frame = CGRectMake(10, 5, SCREEN_WIDTH - 20, 40);
        
    } else {
        [UIView viewRediusForLeftAndReightOfTop:_whiteView withRedius:0];
    _whiteView.frame = CGRectMake(10, 0, SCREEN_WIDTH - 20, 40);
    }
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
